:root {
    --primary-color: #ff6b6b; /* 番茄红 */
    --secondary-color: #4ecdc4; /* 薄荷绿 */
    --bg-color: #f7fff7; /* 浅色背景 */
    --text-color: #2d3436;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.dynamic-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0.1;
    z-index: -1;
    transition: opacity 1s ease;
}

.container {
    text-align: center;
    max-width: 400px;
    width: 90%;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.timer-display {
    font-size: 5rem;
    font-weight: bold;
    margin: 1rem 0;
    color: var(--primary-color);
    transition: color var(--transition-speed) ease;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

button:active {
    transform: scale(0.95);
}

.settings {
    margin: 1.5rem 0;
    display: grid;
    gap: 0.5rem;
}

.settings label {
    font-weight: 500;
}

.settings input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 100%;
}

.session-info {
    margin-top: 1.5rem;
}

#long-break-btn {
    background-color: var(--secondary-color);
    margin-top: 1rem;
}

#notification-permission {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background-color: var(--secondary-color);
    z-index: 1000;
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes confetti {
    0% { transform: translateY(0) rotate(0); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes background-pulse {
    0% { opacity: 0.1; }
    50% { opacity: 0.2; }
    100% { opacity: 0.1; }
}

.complete-animation {
    animation: pulse 0.5s ease-in-out;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    animation: confetti 2s ease-out forwards;
    opacity: 0;
}

/* 按钮微动效 */
button {
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

button:active {
    transform: scale(0.95);
}

/* 数字过渡效果 */
.timer-display span {
    display: inline-block;
    transition: transform 0.3s ease;
}

.timer-display span.changing {
    transform: translateY(-10px);
    opacity: 0;
}

/* 完成状态样式 */
.complete-state {
    animation: background-pulse 2s infinite;
}

.complete-state .timer-display {
    color: var(--secondary-color);
    animation: pulse 1s infinite;
}

.complete-state .dynamic-background {
    opacity: 0.2;
}